package me.ylduan.ch2.util;

import org.apache.commons.lang3.StringUtils;

/**
 * 字符串是否为空
 *
 * @author Zero
 * @created 2017/5/9 18:14
 */
public final class StringUtil {
    private StringUtil() {
    }

    /**
     * 带有trim的验空
     */
    public static boolean isEmpty(String str) {
        if (str != null) {
            str = str.trim();
        }
        return StringUtils.isEmpty(str);
    }

    /**
     * 带有trim的验证非空
     */
    public static boolean isNotEmpty(String str) {
        return !isEmpty(str);
    }
}
